-
Notifications
You must be signed in to change notification settings - Fork 22
[Chore] Validate API key in the init flow #932
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
| # On Windows, create a batch file in the user's home directory (not auto-run, just used to store api key) | ||
| shell_rc_path.touch() | ||
| click.echo(f"✅ Created {shell_rc_path}") | ||
| get_user_id(api_key=api_key) # Used to verify whether the API key is valid. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@HeshamHM28 how are you using the result of get_user_id?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.

User description
fixes CF-864
PR Type
Bug fix, Enhancement
Description
Validate API key during init flow
Import and call
get_user_idfor verificationPreserve existing API key save behavior
Diagram Walkthrough
File Walkthrough
cmd_init.py
Add API key validation via get_user_idcodeflash/cli_cmds/cmd_init.py
get_user_idfromcodeflash.api.cfapi.get_user_id(api_key)before saving key to rc.